<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var a1 = prompt('请输入一个数');

      if (a1 % 2 > 0) {
        console.log(alert('奇数'));
      } else if (2 > a1 % 2) {
        console.log(alert('偶数'));
      }

     
    </script>
  </body>
</html>
